﻿using System;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Media;

namespace ViewLibrary.Controls
{
	public class TTextBox : TextBox
	{
		private Brush _normalBackground = Brushes.White;
		[Category("Brush")]
		public Brush NormalBackground
		{
			get { return _normalBackground; }
			set { _normalBackground = value; }
		}

		private Brush _focusedBackground = Brushes.Beige;
		[Category("Brush")]
		public Brush FocusedBackground
		{
			get { return _focusedBackground; }
			set { _focusedBackground = value; }
		}

		protected override void OnGotFocus(System.Windows.RoutedEventArgs e)
		{
			base.OnGotFocus(e);
			this.Background = _focusedBackground;
		}
		protected override void OnLostFocus(System.Windows.RoutedEventArgs e)
		{
			base.OnLostFocus(e);
			this.Background = _normalBackground;
		}
	}
}